package com.crm.service.impl.sys.permissionManagement;

import com.crm.dao.mapper.customMapper.sys.InvoiceCompanyInfoCustomMapper;
import com.crm.dao.mapper.sys.permissionManagement.SysInvoiceCompanyInfoMapper;
import com.crm.model.entity.sys.permissionManagement.SysInvoiceCompanyInfo;
import com.crm.model.qo.sys.InvoiceCompanyInfoQO;
import com.crm.model.vo.sys.InvoiceCompanyInfoVO;
import com.crm.service.sys.permissionManagement.SysInvoiceCompanyInfoDbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author:chaifuyou
 * @Date: 2021/7/27 14:03
 */
@Service
public class SysInvoiceCompanyInfoDbServiceImpl implements SysInvoiceCompanyInfoDbService {

    @Autowired
    private SysInvoiceCompanyInfoMapper sysInvoiceCompanyInfoMapper;

    @Autowired
    private InvoiceCompanyInfoCustomMapper invoiceCompanyInfoCustomMapper;

    /**
     * 增加开票公司详情
     * @param invoiceCompanyInfo
     */
    @Override
    public void addInvoiceCompanyInfo(SysInvoiceCompanyInfo invoiceCompanyInfo) {
        sysInvoiceCompanyInfoMapper.insertSelective(invoiceCompanyInfo);
    }

    /**
     * 修改开票公司详情
     * @param invoiceCompanyInfo
     */
    @Override
    public void updateInvoiceCompanyInfo(SysInvoiceCompanyInfo invoiceCompanyInfo) {
        sysInvoiceCompanyInfoMapper.updateByPrimaryKeySelective(invoiceCompanyInfo);
    }

    /**
     * 查询公司详情列表
     * @param invoiceCompanyInfoQO
     * @return
     */
    @Override
    public List<InvoiceCompanyInfoVO> selectInvoiceCompanyInfo(InvoiceCompanyInfoQO invoiceCompanyInfoQO) {
        return invoiceCompanyInfoCustomMapper.selectInvoiceCompanyInfo(invoiceCompanyInfoQO);
    }
}
